thermo28 2.2.2
Loading...
Searching...
No Matches
thermo28


Thermo 28 Click

Thermo 28 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Nenad Filipovic
  • Date : Nov 2022.
  • Type : I2C type

Software Support

Example Description

This example demonstrates the use of Thermo 28 Click board™ by reading and displaying the temperature measurements.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Thermo28

Example Key Functions

Application Init

Initializes the driver and performs the Click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
thermo28_cfg_t thermo28_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
thermo28_cfg_setup( &thermo28_cfg );
if ( I2C_MASTER_ERROR == thermo28_init( &thermo28, &thermo28_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
Delay_ms ( 100 );
if ( THERMO28_ERROR == thermo28_default_cfg ( &thermo28 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
Delay_ms ( 100 );
}
#define THERMO28_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition thermo28.h:127
void application_init(void)
Definition main.c:34
#define MIKROBUS_POSITION_THERMO28
Definition main.c:28
@ THERMO28_ERROR
Definition thermo28.h:142

Application Task

This is an example that shows the use of a Thermo 28 Click board™. Reads the temperature measurement in degree Celsius and displays the results. Results are being sent to the Usart Terminal where you can track their changes.

void application_task ( void )
{
float temperature;
if ( THERMO28_OK == thermo28_get_temperature( &thermo28, &temperature ) )
{
log_printf( &logger, " Temperature [degC]: %.2f \r\n", temperature );
Delay_ms ( 1000 );
}
}
void application_task(void)
Definition main.c:72
@ THERMO28_OK
Definition thermo28.h:141

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.